﻿ IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'P_UpdateLocation')
	BEGIN
		DROP  Procedure  esf_sso.P_UpdateLocation
	END

GO

CREATE Procedure esf_sso.P_UpdateLocation
	@pID					BIGINT
	,@pCityID				BIGINT = NULL
	,@pCountryID			BIGINT = NULL
	,@pName					VARCHAR (100)
	,@pCityName				VARCHAR (60)
	,@pPhoneNumber			VARCHAR (30)
	,@pCellPhoneNumber		VARCHAR (30)
	,@pAddress				VARCHAR (100)
AS

	UPDATE [esf_sso].[Location]
	SET
		[Name] = @pName
		,[CityID] = @pCityID
		,[CountryID] = @pCountryID
		,CityName = @pCityName
		,[PhoneNumber] = @pPhoneNumber
		,[CellPhoneNumber] = @pCellPhoneNumber
		,[Address] = @pAddress
	WHERE
		ID = @pID 
           
GO 